package com.site.pojo;

import com.site.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "tb_test")
public class TestPojo implements Serializable {
    private static final long serialVersionUID = -169520293430625480L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Excel(name = "ID")
    private Integer id;

    @Excel(name = "名称",suffix = "(单位%)")
    private String name;

    @Excel(name = "创建日期",width = 20,dateformat = "yyyy-MM-dd HH:mm:ss")
    @Transient
    private Date createTime;

    @Excel(name = "年龄",readConverterExp = "0=男,1=女,2=未知")
    @Transient
    private Integer age;

    @Excel(name = "测试数字默认值")
    @Transient
    private Integer num;

    @Excel(name = "测试数字默认值1",readConverterExp = "100=差,200=良好,300=优秀")
    @Transient
    private Integer aa;

    @Excel(name = "测试数字默认值2",readConverterExp = "100=差,200=良好,300=优秀")
    @Transient
    private Long bb;

    @Excel(name = "测试数字默认值3",readConverterExp = "100.00=差,200.00=良好,300.00=优秀")
    @Transient
    private Float cc;

    @Excel(name = "测试数字默认值4",readCoverDefaultValue = true, readConverterExp = "100.00=差,200.00=良好,300.00=优秀")
    @Transient
    private Double dd;

    @Transient
    private Integer testTableId;

    @Transient
    private Integer testId;
}
